﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using CommunitySystem.CustomerQuery;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace CommunitySystem.Common
{
    public class CustomerQueryColumnType
    {
        private static ObservableCollection<string> list = new ObservableCollection<string>();

        public static ObservableCollection<string> GetTypeList()
        {
            return new ObservableCollection<string>() { "字符型", "数字型", "日期型", "树形", "特殊类型" };
        }
    }

    public class CustomerQueryColumnTable
    {
        private static ObservableCollection<string> list = null;

        public static ObservableCollection<string> GetTypeList()
        {
            return new ObservableCollection<string>() 
            { 
                "Emp_BasicInfo",
                "OrgForHR",
                "Emp_Duty",
                "Emp_Education",
                 "Emp_Degree",
            };
        }
    }

    public static class QueryViewColumns
    {
        public static ObservableCollection<Query_ShowColumn> GetAllCollumns()
        {
            return new ObservableCollection<Query_ShowColumn>()
            {
                new Query_ShowColumn(){ ColumnName="姓名", ColumnCode="emp.Name"},
                new Query_ShowColumn(){ ColumnName="身份证号", ColumnCode="emp.CardNo"},
                new Query_ShowColumn(){ ColumnName="性别", ColumnCode="emp.Gender"},
                new Query_ShowColumn(){ ColumnName="民族", ColumnCode="emp.Native"},
                new Query_ShowColumn(){ ColumnName="政治面貌", ColumnCode="emp.Political"},
                new Query_ShowColumn(){ ColumnName="健康状况", ColumnCode="emp.Health"},
                new Query_ShowColumn(){ ColumnName="婚姻状况", ColumnCode="emp.Marriage"},
                new Query_ShowColumn(){ ColumnName="年龄", ColumnCode="datediff(month, emp.Birthday, getdate())/12"},
                new Query_ShowColumn(){ ColumnName="出生地", ColumnCode="emp.BirthPlace"},
                new Query_ShowColumn(){ ColumnName="籍贯", ColumnCode="emp.NativePlace"},
                new Query_ShowColumn(){ ColumnName="参加工作日期", ColumnCode="CONVERT(VARCHAR(10),emp.WorkDate,23)"},
                new Query_ShowColumn(){ ColumnName="工龄", ColumnCode="datediff(month, emp.WorkDate, getdate())/12"},
                new Query_ShowColumn(){ ColumnName="现工作单位", ColumnCode="org.Name"},
                new Query_ShowColumn(){ ColumnName="现工作部门", ColumnCode="emp.PositionName"},
                new Query_ShowColumn(){ ColumnName="公务员登记号", ColumnCode="emp.RegisterNo"},
                new Query_ShowColumn(){ ColumnName="人员编制类别", ColumnCode="emp.OrganizationType"},
                new Query_ShowColumn(){ ColumnName="进本单位年月", ColumnCode="CONVERT(VARCHAR(10),emp.NowWorkDate,23)"},
                new Query_ShowColumn(){ ColumnName="在本单位工作时间", ColumnCode="datediff(month, emp.NowWorkDate, getdate())/12"},
                new Query_ShowColumn(){ ColumnName="户籍所在地", ColumnCode="emp.HouseholdRegister"},
                new Query_ShowColumn(){ ColumnName="家庭住址", ColumnCode="emp.HomeAddress"},
                new Query_ShowColumn(){ ColumnName="住宅电话", ColumnCode="emp.Phone"},
                new Query_ShowColumn(){ ColumnName="个人身份", ColumnCode="emp.EmpIdentity"},
                new Query_ShowColumn(){ ColumnName="入党时间", ColumnCode="CONVERT(VARCHAR(10),emp.PartyTime,23)"},
                new Query_ShowColumn(){ ColumnName="党龄", ColumnCode="datediff(month, emp.PartyTime, getdate())/12"},
                new Query_ShowColumn(){ ColumnName="专业技术职务", ColumnCode="emp.TechnicalPositions"},
                new Query_ShowColumn(){ ColumnName="人员类别", ColumnCode="emp.PersonnelType"},

                new Query_ShowColumn(){ ColumnName="最高学历", ColumnCode="edu.EducationName"},
                new Query_ShowColumn(){ ColumnName="毕业学校", ColumnCode="edu.School"},
                new Query_ShowColumn(){ ColumnName="专业", ColumnCode="edu.Professional"},

                new Query_ShowColumn(){ ColumnName="现任职务层次", ColumnCode="duty.DutyLevel"},
                new Query_ShowColumn(){ ColumnName="现任职务属性", ColumnCode="duty.DutyAttribute"},
                //new Query_ShowColumn(){ ColumnName="现任职务批准时间", ColumnCode="duty.PersonnelType"},
                new Query_ShowColumn(){ ColumnName="现任职务任职方式", ColumnCode="duty.ServiceMode"},
            };
        }
    }

    public class QueryViewClass
    {

        public string column1 { get; set; }
        public string column2 { get; set; }
        public string column3 { get; set; }
        public string column4 { get; set; }
        public string column5 { get; set; }
        public string column6 { get; set; }
        public string column7 { get; set; }
        public string column8 { get; set; }
        public string column9 { get; set; }
        public string column10 { get; set; }
        public string column11 { get; set; }
        public string column12 { get; set; }
        public string column13 { get; set; }
        public string column14 { get; set; }
        public string column15 { get; set; }
        public string column16 { get; set; }
        public string column17 { get; set; }
        public string column18 { get; set; }
        public string column19 { get; set; }
        public string column20 { get; set; }
        public string column21 { get; set; }
        public string column22 { get; set; }
        public string column23 { get; set; }
        public string column24 { get; set; }
        public string column25 { get; set; }
        public string column26 { get; set; }
        public string column27 { get; set; }
        public string column28 { get; set; }
        public string column29 { get; set; }
        public string column30 { get; set; }
        public string column31 { get; set; }
        public string column32 { get; set; }
        public string column33 { get; set; }
        public string column34 { get; set; }
        public string column35 { get; set; }
        public string column36 { get; set; }
        public string column37 { get; set; }
        public string column38 { get; set; }
        public string column39 { get; set; }
        public bool IsSelected { get; set; }
        public int index { get; set; }

    }

    public class QueryValueCompetor
    {
        public static ObservableCollection<CompetorClass> StringCompetors = new ObservableCollection<CompetorClass>()
        {            
           new CompetorClass(){Name="等于", Sign= "="},
            new CompetorClass(){Name="不等于", Sign= "!="},
            new CompetorClass(){Name="包涵", Sign= "in"},
            new CompetorClass(){Name="不包涵", Sign= "not in"}
        };
        public static ObservableCollection<CompetorClass> DateIntCompetors = new ObservableCollection<CompetorClass>()
        {
           new CompetorClass(){Name="之间", Sign= "between"},
          new CompetorClass(){Name="等于", Sign=  "="},
          new CompetorClass(){Name="大于", Sign=  ">"},
          new CompetorClass(){Name="大于等于", Sign=  ">="},
          new CompetorClass(){Name="小于", Sign= "<"},
         new CompetorClass(){Name="小于等于", Sign=   "<="},
          new CompetorClass(){Name="不等于", Sign=  "!="}
        };
    }

    public class CompetorClass 
    {

        public string Name { set; get; }

        public string Sign { set; get; }

        //public event PropertyChangedEventHandler PropertyChanged;
    }
}
